package com.gollum.common.enums;

import com.gollum.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 逻辑删除枚举值
 * @author Herther
 * @version 1.0.0
 * @createTime 2022年08月26日 23:25:00
 */
public enum LogicalDeleteType {

    NORMAL("0", "正常"){
        @Override
        public Boolean isDelete(String value){
            return StringUtils.equals(value, NORMAL.value);
        }
    }, DELETED("1", "删除") {
        @Override
        public Boolean isDelete(String value) {
            return StringUtils.equals(value, DELETED.value);
        }
    };



    private String value;
    private String name;

    LogicalDeleteType(String value,String name){
        this.value = value;
        this.name = name;
    }

    public abstract Boolean isDelete(String value);

    public static void main(String[] args) {
        Boolean aBoolean = LogicalDeleteType.DELETED.isDelete("0");
        System.out.println(aBoolean);
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

}
